package com.lqh.studyproject.agentmodel;

/**
 * @ClassName PersonDaoProxy
 * @Description studyproject
 * @Author bgy-lqh
 * @Date 2020/5/29 18:08
 * @Version 代理对象  静态代理的demo
 **/
public class PersonDaoProxy implements IPersonDao{
    private IPersonDao target;
    public PersonDaoProxy(IPersonDao target) {
        this.target = target;

    }
    @Override
    public void update() {
        System.out.println("修改个人信息前记录日志");
        this.target.update();
        System.out.println("修改个人信息后记录日志");
    }

    public static void main(String[] args){
        PersonDao p = new PersonDao();
        PersonDaoProxy pProxy = new PersonDaoProxy(p);
        pProxy.update();
    }
}